<?php
namespace common\api\overseaWarehouseAPI;
/*+----------------------------------------------------------------------
| 小老板
+----------------------------------------------------------------------
| Copyright (c) 2011 http://www.xiaolaoban.cn All rights reserved.
+----------------------------------------------------------------------
| Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+----------------------------------------------------------------------
| Author: qfl <772821140@qq.com>
+----------------------------------------------------------------------
| Create Date: 2015-04-13
+----------------------------------------------------------------------
 */

/**
 +------------------------------------------------------------------------------
 * 海外仓api抽象类
 +------------------------------------------------------------------------------
 * @category	common
 * @package		common/overseaWarehouseAPI
 * @subpackage  Exception
 * @author		qfl<772821140@qq.com>
 * @version		1.0
 +------------------------------------------------------------------------------
 */
abstract class BaseOverseaWarehouseAPI {

	/**
	 +----------------------------------------------------------
	 * 获取返回值方法
	 +----------------------------------------------------------
	 * @access protected
	 +----------------------------------------------------------
	 * @param $error		错误代码 0：为成功
	 * @param $data			数据
	 * @param $msg			错误消息
	 +----------------------------------------------------------
	 * @return	$result
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	public static function getResult($error = 0, $data, $msg) {
		return array('error' => $error, 'data' => $data, 'msg' => $msg);
	}

	/**
	 +----------------------------------------------------------
	 * 申请订单号
	 +----------------------------------------------------------
	 * @access public
	 +----------------------------------------------------------
	 * @param $data		包裹及物流商相关参数(多个包裹)
	 +----------------------------------------------------------
	 * @return	apiResult 
	 * array(
	 *	'key为shipping_method' => array(
	 *		'key为delivery_id' => self::getResult(0, '此处为获取的order_no', ''),
	 *		'key为delivery_id' => self::getResult(非0的errorCode, '', '错误信息')
	 *	)
	 * )
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	abstract public function getOrderNO($data);
	/**
	 +----------------------------------------------------------
	 * 取消跟踪号
	 +----------------------------------------------------------
	 * @access public
	 +----------------------------------------------------------
	 * @param $data		包裹及物流商相关参数(多个包裹)
	 +----------------------------------------------------------
	 * @return	apiResult 
	 * array(
	 *	'key为shipping_method' => array(
	 *		'key为delivery_id' => self::getResult(0, '此处为获取的tracking_no', ''),
	 *		'key为delivery_id' => self::getResult(非0的errorCode, '', '错误信息')
	 *	)
	 * )
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	abstract public function cancelOrderNO($data);
	/**
	 +----------------------------------------------------------
	 * 交运
	 +----------------------------------------------------------
	 * @access public
	 +----------------------------------------------------------
	 * @param $data		包裹及物流商相关参数(多个包裹)
	 +----------------------------------------------------------
	 * @return	apiResult 
	 * array(
	 *	'key为shipping_method' => array(
	 *		'key为delivery_id' => self::getResult(0, '此处为获取的tracking_no', ''),
	 *		'key为delivery_id' => self::getResult(非0的errorCode, '', '错误信息')
	 *	)
	 * )
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	abstract public function doDispatch($data);

	/**
	 +----------------------------------------------------------
	 * 申请跟踪号
	 +----------------------------------------------------------
	 * @access public
	 +----------------------------------------------------------
	 * @param $data		包裹及物流商相关参数(多个包裹)
	 +----------------------------------------------------------
	 * @return	apiResult 
	 * array(
	 *	'key为shipping_method' => array(
	 *		'key为delivery_id' => self::getResult(0, '此处为获取的tracking_no', ''),
	 *		'key为delivery_id' => self::getResult(非0的errorCode, '', '错误信息')
	 *	)
	 * )
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	abstract public function getTrackingNO($data);

	/**
	 +----------------------------------------------------------
	 * 打单
	 +----------------------------------------------------------
	 * @access public
	 +----------------------------------------------------------
	 * @param $data		包裹及物流商相关参数(多个包裹)
	 +----------------------------------------------------------
	 * @return	apiResult 
	 * array(
	 *	'mainResult' => 此处为下载合并后的url, //合并后的url地址
	 *	'data' => array (
	 *		'key为shipping_method' => array(
	 *			'key为delivery_id' => self::getResult(0, '此处为下载运单的url（单个包裹）', ''),
	 *			'key为delivery_id' => self::getResult(非0的errorCode, '', '错误信息')
	 *		)
	 *	)
	 * )
	 +----------------------------------------------------------
	 * log			name	date					note
	 * @author		hxl		2014/08/07				初始化
	 +----------------------------------------------------------
	 **/
	abstract public function doPrint($data);

}
